﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Light_Calendar
{
    /// <summary>
    /// Interaction logic for DetailCell.xaml
    /// </summary>
    public partial class DetailCell : UserControl
    {
        private Light_Calendar.MainWindow mainWindow;

        public DetailCell()
        {
            InitializeComponent();

            mainWindow = (Light_Calendar.MainWindow)App.Current.MainWindow;
        }

        private void ScrollViewer_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (!mainWindow.IsEditing) mainWindow.New(mainWindow.FocusedDate);
            e.Handled = true;
        }

        private void new_Click(object sender, RoutedEventArgs e)
        {
            if (!mainWindow.IsEditing) mainWindow.New(mainWindow.FocusedDate);
        }

        private void today_Click(object sender, RoutedEventArgs e)
        {
            mainWindow.FocusDate(DateTime.Today);
        }
    }
}
